<template>
	<div class="main">
		<div class="adOuterWrap">
			<div class="back">
				<!-- <go-back aa="ad"></go-back> -->
				<headerBack></headerBack>
				<h2>综合测试报告记录<b class="bs" v-show="flag==false" @click="commonJs.gopush('evaluationEntry')">新的测试</b></h2>
			</div>
			<div class="adWrap">
				<scroller style="top: 1.6rem;">
					<div>
						<div class="adBoxs">
							<div class="listBox">
								<span v-show="flag" class="txtBox" @click="commonJs.gopush('evaluationEntry')">
									<i>您有未完成能的综合的测试</i>
									<b>点击继续</b>
								</span>
								<report-list :zhData='zhDatas'></report-list>
							</div>
						</div>
						<div style="width: 100%;height: 1.6rem;"></div>
					</div>
				</scroller>
			</div>
		</div>
	</div>
</template>
<script>
	import ls from 'store2';
	import headerBack from '~/components/headerBack'
	import reportList from '~/components/reportList'
	import { getReportList} from '~/api/evaluation'
	export default {
		head: {
			title: '生涯测评'
		},
		components: {
			headerBack,
			reportList
		},
		created() {
		},
		data() {
			return {
				zhDatas: [],
				flag: false
			}
		},
		mounted: function() {
			this.$visit(this.$route.path)
			this.showZongheList();
			ls.set('preUrl', '../evaluation/reportRecord')

		},
		watch: {

		},
		methods: {

			showZongheList() {
				this.$loading('open')
				getReportList(ls.get('userType')).then(res => {
					if (res.code === '0') {
						let zhData = res.data;
						// filter回调函数
						if (zhData[0].generate === 0) {
							this.flag = true;
						}
						var dofilter = function(element, index, array) {
							if (element.generate < 1) { // 过滤
								return false;
							}
							return true;
						}
						this.zhDatas = zhData.filter(dofilter);
						this.$hideLoading()

					}
				}).catch(() => {
					this.$hideLoading()

				})
			},


		}


	}
</script>

<style scoped lang="less">
	.adOuterWrap {
		width: 7.5rem;
		height: 100vh;
		background: #fff;
		flex-direction: column;
		overflow: hidden;

		.adWrap {

			padding: 0 0.3rem;
			width: 7.5rem;
			box-sizing: border-box;

			.adBoxs {
				width: 100%;
				height: auto;

				.listBox {
					height: auto;
					padding: 0.3rem 0.3rem;
					box-sizing: border-box;

					.txtBox {
						display: block;
						width: 100%;
						height: 0.8rem;
						background: rgba(255, 241, 184, 1);
						border-radius: 0.1rem;
						opacity: 0.6;
						text-align: center;
						line-height: 0.8rem;

						i,
						b {
							font-size: 0.22rem;

							font-weight: bold;
							color: rgba(34, 34, 34, 1);

						}

						b {
							margin-left: 0.1rem;
							color: @mainColor;
						}
					}

				}


			}
		}


	}

	.back {
		width: 100%;
		height: auto;
		h2 {
			padding: 0 0.3rem;
			box-sizing: border-box;
			display: block;
			height: 0.8rem;
			font-size: 0.44rem;
			font-weight: bold;
			color: rgba(34, 34, 34, 1);
			line-height: 0.8rem;

			.bs {
				float: right;
				font-size: 0.26rem;
				color: @mainColor;
			}
		}
	}
</style>
